Inheritance

Inheritance in CSS#

CSS supports inheritance, that means if the parent has some properties then will give them to his children (children here are the nested elements).

but let us know who is the parent and who are the children ?

final result

So, CSS supports transfer the properties (CSS properties) from the parent to the children. like if the color of text in the parent is Orange then by default (else you changed it) the color of text in the children will be Orange.

Example :

1 - index.html#

final result

2 - index.css#

final result

3 - final result#

final result

final note: not all properties are inherited so here is a reference of all inherited properties in css Inherited Properties In CSS